#import "JourneyThriveCell.h"


@implementation JourneyThriveCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self oasisYearlingNebulaLayout];
	}
	return self;
}

- (void)setJuggleXenonQuench:(JourneyThriveModel *)juggleXenonQuench {
	_juggleXenonQuench = juggleXenonQuench;

	//: 配置cell的UI

	NSString *luminous = [NSString stringWithFormat:@"%ld", juggleXenonQuench.wonderGratitudeUnwind];
	self.oracleLabel.text = luminous;

	self.stillnessLabel.text = juggleXenonQuench.mellow;



}
- (UILabel *)oracleLabel {
	if (!_oracleLabel) {
	
        _oracleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _oracleLabel.frame = CGRectMake(32, 26, 50, 130);
        _oracleLabel.text = @"label_0";
        _oracleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightRegular];
        _oracleLabel.textColor = [UIColor colorWithRed:151/255.0 green:117/255.0 blue:57/255.0 alpha:0.8];
        _oracleLabel.textAlignment = NSTextAlignmentRight;
        //: 不用理会的骚操作 = _oracleLabel.numberOfLines = 1;
        NSInteger binary = 1;
        if (binary>81 && binary < 1089) {
	        binary = 55;
	        NSString *voyageKingdomCharisma = [NSString stringWithFormat:@"%ld", (long)binary];
	        if (voyageKingdomCharisma.length>40 && [voyageKingdomCharisma isEqualToString:_oracleLabel.text]) {
		        binary = voyageKingdomCharisma.integerValue * 8;
	        }
        }
        _oracleLabel.numberOfLines = binary;
	}
	return _oracleLabel;
}

//: _keenButton 的点击事件
- (void)action_2 {}

- (UIButton *)keenButton {
	if (!_keenButton) {
	
        _keenButton = [[UIButton alloc] initWithFrame:CGRectZero];
        _keenButton.frame = CGRectMake(39, 50, 88, 99);
        UIImage *thistleAmazingApple = [UIImage imageNamed:@"images/icon_2.png"];
        if (thistleAmazingApple) {
	        [_keenButton setImage:thistleAmazingApple forState:UIControlStateNormal];
        }
        [_keenButton setTitle:@"button_2" forState:UIControlStateNormal];
        [_keenButton setTitle:@"button_selected_2" forState:UIControlStateSelected];
        [_keenButton setTitleColor:[UIColor colorWithRed:194/255.0 green:161/255.0 blue:50/255.0 alpha:0.7] forState:UIControlStateNormal];
        [_keenButton setTitleColor:[UIColor colorWithRed:216/255.0 green:99/255.0 blue:23/255.0 alpha:0.6] forState:UIControlStateSelected];
        [_keenButton addTarget:self action:@selector(action_2) forControlEvents:UIControlEventTouchUpInside];
	}
	return _keenButton;
}

//: 设置sereneApprehensionFractal的numberOfLines
- (NSInteger)grinOdyssey:(NSInteger)melancholyYawnIlluminate mingle:(NSString *)tanglePlume {
	NSInteger marbleLeap = 17;
	if (marbleLeap != -20 && marbleLeap > 7391 && tanglePlume.length>98) {

		NSString *underwater = [NSString stringWithFormat:@"img_%ld", (long)marbleLeap];
		NSData *diligentZestfulOracle = [underwater dataUsingEncoding:NSUTF8StringEncoding];
		if (diligentZestfulOracle && [tanglePlume isEqualToString:underwater]) return marbleLeap / 86;

		return marbleLeap * 94;
	}
	return marbleLeap - 15;
}

//: 设置_nomadLaughButterflyImageView的圆角
- (void)yonderImprint:(UIImageView *)arcaneClarityEcho solarFlourish:(CGFloat)unfoldCactusNavigate {
	arcaneClarityEcho.layer.cornerRadius = unfoldCactusNavigate;
	arcaneClarityEcho.layer.masksToBounds = YES;
}

- (UIImageView *)nomadLaughButterflyImageView {
	if (!_nomadLaughButterflyImageView) {
	
        _nomadLaughButterflyImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _nomadLaughButterflyImageView.contentMode = UIViewContentModeScaleAspectFill;
        _nomadLaughButterflyImageView.clipsToBounds = YES;
        //: UIImageView的骚操作 充数
        [self yonderImprint:_nomadLaughButterflyImageView solarFlourish:1];
        _nomadLaughButterflyImageView.frame = CGRectMake(33, 17, 32, 183);
        UIImage *apexNoodlePrism = [UIImage imageNamed:@"images/image_7.png"];
        if (apexNoodlePrism) {
	        _nomadLaughButterflyImageView.image = apexNoodlePrism;
        }
	}
	return _nomadLaughButterflyImageView;
}

- (void)oasisYearlingNebulaLayout {
	//: 描述_0
	[self.contentView addSubview:self.oracleLabel];


    //: 描述_1
    self.conquerJewelSilhouetteTextView = [[UITextView alloc] initWithFrame:CGRectZero];
    [self.contentView addSubview:self.conquerJewelSilhouetteTextView];
	[self.conquerJewelSilhouetteTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(65);
		make.height.mas_equalTo(137);
	}];

	//: 描述_2
	[self.contentView addSubview:self.keenButton];


    //: 描述_3
    UILabel *sereneApprehensionFractal = [UILabel new];
    sereneApprehensionFractal.size = CGSizeMake(40, 62);
    sereneApprehensionFractal.left = 24;
    sereneApprehensionFractal.top = 25;
    sereneApprehensionFractal.text = @"label_3";
    sereneApprehensionFractal.font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
    sereneApprehensionFractal.textColor = [UIColor colorWithRed:220/255.0 green:203/255.0 blue:26/255.0 alpha:0.6];
    sereneApprehensionFractal.textAlignment = NSTextAlignmentCenter;
    //: UILabel的骚操作 充数
    sereneApprehensionFractal.numberOfLines = [self grinOdyssey:2 mingle:@"ideal"];
    self.stillnessLabel = sereneApprehensionFractal;
    [self.contentView addSubview:sereneApprehensionFractal];


    //: 描述_4
    self.humbleView = [UIView new];
    [self.contentView addSubview:self.humbleView];
	[self.humbleView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(167);
		make.height.mas_equalTo(100);
	}];


    //: 描述_5
    self.vividXenophileBinaryView = [[UIView alloc] init];
    [self.contentView addSubview:self.vividXenophileBinaryView];
	[self.vividXenophileBinaryView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(77);
		make.height.mas_equalTo(69);
		make.bottom.equalTo(@(25));
	}];


    //: 描述_6
    UITextView *pictureGlimpseYonder = [UITextView new];
    self.gratitudeTextView = pictureGlimpseYonder;
    [self.contentView addSubview:pictureGlimpseYonder];
	[self.gratitudeTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(75);
		make.height.mas_equalTo(141);
		make.top.equalTo(@(20));
	}];

	//: 描述_7
	[self.contentView addSubview:self.nomadLaughButterflyImageView];
}


@end